home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 33 / Amiga Format AFCD33 (Issue 117, Dec 1998).iso / -seriously_amiga- / graphics / splitmpegppc / src / dialog.c next >
C/C++ Source or Header  |  1998-09-07  |  4KB  |  122 lines

  1. /*
  2.  * Copyright (c) 1994 Michael Simmons
  3.  * All rights reserved.
  4.  * 
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose, without fee, and without written agreement is
  7.  * hereby granted, provided that the above copyright notice and the following
  8.  * two paragraphs appear in all copies of this software.
  9.  * 
  10.  * IN NO EVENT SHALL MICHAEL SIMMONS BE LIABLE TO ANY PARTY FOR
  11.  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  12.  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MICHAEL SIMMONS
  13.  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14.  * 
  15.  * THE MICHAEL SIMMONS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16.  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17.  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18.  * ON AN "AS IS" BASIS, AND MICHAEL SIMMONS HAS NO OBLIGATION TO
  19.  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20.  *
  21.  * I can be contacted via 
  22.  * Email: michael@ecel.uwa.edu.au
  23.  * Post: P.O. Box 506, NEDLANDS WA 6009, AUSTRALIA
  24.  *
  25.  * Amigaversion by Tobias Seiler in 1997
  26.  * Email: tabs@blader.com
  27.  *
  28.  */
  29.  
  30. #include "main.h"
  31.  
  32. void dialog_msg(char *msg)
  33. {
  34.     printf("\n%s\n",msg);
  35. }
  36.  
  37. void dialog_end()
  38. {
  39.     printf("\nProcessing Complete\n");
  40.     printf("  Processed %d Packs",pack_cnt);
  41.     printf(" , %d system headers",system_header_cnt);
  42.     printf(" and %d Packets\n",packet_cnt);
  43. }
  44.  
  45. void dialog_progress()
  46. {
  47.     static int state = 0;
  48.     static char *progress_char = "\\|/-";
  49.  
  50.     printf("\b%c",progress_char[state++]);
  51.     if( state== 4)
  52.         state=0;
  53. }
  54.  
  55. void dialog_pack_header(Pack_Header *pack_header, int pack_num)
  56. {
  57.     double SCR;
  58.  
  59.     if( quiet_flag )
  60.         return;
  61.  
  62.     SCR = pack_header->SCR_hibit * pow(2.0,32.0); 
  63.     SCR = SCR + pack_header->SCR;
  64.  
  65.     printf("\nPACK %d SCR=%g Mux date rate = %d bytes per second ",pack_num,SCR, pack_header->mux_rate *50);
  66. }
  67.  
  68. void dialog_system_header(System_Header *system_header)
  69. {
  70.     int stream_id;
  71.     
  72.     if( quiet_flag )
  73.         return;
  74.  
  75.     printf("\nSYSTEM HEADER\n");
  76.     printf("-------------\n");
  77.  
  78.     printf("Maximum Multiplexed data rate =%d bytes per second\n", system_header->rate_bound * 50);
  79.     printf("Max number of audio streams = %d\n",system_header->audio_bound);
  80.  
  81.     if( system_header->fixed_flag )
  82.         printf("Bitrate is fixed\n");
  83.     else
  84.         printf("Bitrate is variable\n");
  85.  
  86.     if( system_header->CSPS_flag )
  87.         printf("Multiplexed stream meets constrained parameters\n");
  88.     else
  89.         printf("Multiplexed stream does not meets constrained parameters\n");
  90.  
  91.     if( system_header->audio_lock_flag )
  92.         printf("There is a ");
  93.     else
  94.         printf("There is no ");
  95.     printf("constant rational relationship between the\n");
  96.     printf("audio sampling rate and the system clock frequency in the system\n");
  97.     printf("target decoder\n");
  98.  
  99.     if( system_header->video_lock_flag )
  100.         printf("There is a ");
  101.     else
  102.         printf("There is no ");
  103.     printf("constant rational relationship between the\n");
  104.     printf("video picture rate and the system clock frequency in the system\n");
  105.     printf("target decoder\n");
  106.  
  107.     printf("Max number of video streams = %d\n",system_header->video_bound);
  108.     printf("Reserved_byte = %0x\n",system_header->reserved_byte);
  109.  
  110.     printf("Stream Information\n");
  111.     for( stream_id =0; stream_id<MAX_NUM_STREAMS; stream_id++)
  112.         if( system_header->STD_flag[stream_id] ){
  113.             printf("    for stream %0x : ",stream_id + RESERVED_STREAM);
  114.             if( system_header->STD_scale_bound[stream_id] )
  115.                 printf("        Buffer bound = %d bytes\n",system_header->STD_size_bound[stream_id] * 128);
  116.             else
  117.                 printf("        Buffer bound = %d bytes\n",system_header->STD_size_bound[stream_id] * 1024);
  118.         }
  119.     printf("\n");
  120. }
  121.  
  122.